﻿<local:DocumentBase x:Class="WPFExcelReport.SETUPRAWYARN"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    Title="参数设定"   HorizontalAlignment="Stretch"
                    Loaded="Window_Loaded"
                    VerticalAlignment="Stretch"
                    Height="400"
                    >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <db:SETINTEXDB x:Key="SetData" />
        <CollectionViewSource x:Key="vwYARNPRICE" Source="{Binding Path=YARNPRICE, Source={StaticResource SetData}}" />
    </local:DocumentBase.Resources>
    <Grid>
        <StackPanel>
           <TabControl>
                <TabItem Header="纱价维护">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="60" Name="gdynr1"></RowDefinition>
                            <RowDefinition Height="1*" Name="gdynr2"></RowDefinition>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="1*" Name="gdync2"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <WrapPanel  Grid.Row="0">
                            <Button    Height="34" Margin="0,0,0,0" Name="btnYnLoad" Width="34" Click="btnYnLoad_Click" >
                                <Button.Background>
                                    <ImageBrush ImageSource="/IntexReportClient;component/Images/Reload.png" />
                                </Button.Background>
                            </Button>
                            <Button    Height="34" Margin="0,0,0,0"  Name="btnYnSave" Width="34" Click="btnYnSave_Click" >
                                <Button.Background>
                                    <ImageBrush ImageSource="/IntexReportClient;component/Images/Save.png" />
                                </Button.Background>
                            </Button>
                            <Button    Height="34" Margin="0,0,0,0"  Name="btnYPStartXls" Width="Auto" Click="btnYPStartXls_Click" >
                                Intex数据初始化
                            </Button> 
                            <TextBox Name="txtYarn" Width="80" Background="Green"></TextBox>

                        </WrapPanel>
                        <DataGrid Grid.Row="1"  
                          ItemsSource="{Binding Source={StaticResource vwYARNPRICE}}" 
                          RowDetailsVisibilityMode="VisibleWhenSelected"
                          AutoGenerateColumns="False" 
                          Height="Auto" 
                          Width="Auto"
                          HorizontalScrollBarVisibility="Auto"
                          VerticalScrollBarVisibility="Auto"
                          MaxWidth="{Binding Path=Width, ElementName=gdync2}"
                          >
                            <DataGrid.Columns>
                                <DataGridTextColumn Binding="{Binding Path=YSUPNAME}" Header="供应商" Width="120" />
                                <DataGridTextColumn Binding="{Binding Path=YYARN}" Header="纱" Width="180" />
                                <DataGridTextColumn Binding="{Binding Path=YVAR}" Header="var" Width="40" />
                                <DataGridTextColumn Binding="{Binding Path=YCOLOR}" Header="色号" Width="80" />
                                <DataGridTextColumn Binding="{Binding Path=YCPRICE}" Header="价格" Width="80" />
                                <DataGridTextColumn Binding="{Binding Path=YUOM}" Header="单位" Width="60" />
                                <DataGridTextColumn Binding="{Binding Path=YEFFECTDATE}" Header="日期" Width="80" />
                            </DataGrid.Columns>
                        </DataGrid>
                    </Grid>
                </TabItem>
            </TabControl>
        </StackPanel>
    </Grid>
</local:DocumentBase>
